FROM php:8.0.30-fpm

#docker buildx build -t 43.138.217.116:8077/k8sphp/phpcrons:v1.4  -f TestBase.Dockerfile --platform=linux/amd64 .
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

RUN echo "\n deb http://ftp.cn.debian.org/debian bookworm main \n" >> /etc/apt/sources.list

RUN apt-get update
RUN apt-get install -y  libonig-dev \
    libpng-dev \
    libzip-dev \
    libxml2-dev \
    cron \
    vim \
    unzip
RUN docker-php-ext-install zip \
#    gd mbstring xml \
    mbstring \
    gd \
    xml \
    pdo_mysql \
    sockets \
    pdo


ADD crontabs/root /var/spool/cron/crontabs/root
RUN chown -R root:crontab /var/spool/cron/crontabs/root \
 && chmod 600 /var/spool/cron/crontabs/root
RUN touch /var/log/cron.log

#
#WORKDIR /app
#
#COPY ./composer.json /app/
#COPY ./composer.lock /app/
#
##RUN composer update
#RUN composer install --no-autoloader --no-scripts
#
#COPY . /app
#
#CMD php artisan serve --host=0.0.0.0 --port=8000
#
#EXPOSE 8000
#
#RUN chmod 777 ./entrypoint.sh
#
#ENTRYPOINT ["./entrypoint.sh"]


